package com.weishuang.monitor.employee.entity;

import com.weishuang.monitor.employee.commons.LocalDateTimeUtils;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;

/**
 * <p>
 * 服务器CPU实时信息
 * </p>
 *
 * @author weishuang
 * @since 2021-03-23
 */
public class ServerCpuRealTime implements BaseEntity,Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 使用率
     */
    private BigDecimal usegeRate;

    /**
     * 创建时间
     */
    private LocalDateTime createTime;

    public BigDecimal getUsegeRate() {
        return usegeRate;
    }

    public void setUsegeRate(BigDecimal usegeRate) {
        this.usegeRate = usegeRate;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    @Override
    public Map<String, Object> toMap() {
        Map<String, Object> map = new HashMap<>();
        map.put("usegeRate", usegeRate);
        map.put("createTime", LocalDateTimeUtils.getUtcToShanghaiDate(createTime));
        return map;
    }
}
